<script type="text/html" template lay-done="layui.data.done(d);">
    <div class="layui-form coreshop-form layui-form-pane" lay-filter="LAY-app-CoreCmsTopUpType-createForm" id="LAY-app-CoreCmsTopUpType-createForm">

        <div class="layui-form-item">
            <label for="title" class="layui-form-label layui-form-required">标题</label>
            <div class="layui-input-inline">
                <input name="title" lay-verType="tips" lay-verify="required|verifytitle" class="layui-input" lay-reqText="请输入标题" placeholder="请输入标题" />
            </div>
            <div class="layui-form-mid layui-word-aux">如冲100送100,或者100这样</div>
        </div>

        <div class="layui-form-item">
            <label for="title" class="layui-form-label layui-form-required">说明</label>
            <div class="layui-input-block">
                <input name="description" lay-verType="tips" class="layui-input" placeholder="请输入说明" lay-reqText="请输入说明" />
            </div>
        </div>

        <div class="layui-form-item">
            <label for="defaultMoney" class="layui-form-label  layui-form-required">充值金额</label>
            <div class="layui-input-inline">
                <input type="number" lay-affix="number" min="0" max="999999" name="defaultMoney" lay-verType="tips" lay-verify="required|number" class="layui-input" value="1" placeholder="请输入充值金额" lay-reqText="请输入充值金额并为数字" />
            </div>
            <div class="layui-form-mid layui-word-aux">充值具体需要支付的金额</div>
        </div>

        <div class="layui-form-item">
            <label for="giftMoney" class="layui-form-label  layui-form-required">赠送金额</label>
            <div class="layui-input-inline">
                <input type="number" lay-affix="number" min="0" max="999999" name="giftMoney" lay-verType="tips" lay-verify="required|number" class="layui-input" value="0" placeholder="请输入赠送金额" lay-reqText="请输入赠送金额并为数字" />
            </div>
            <div class="layui-form-mid layui-word-aux">充值支付后，实际到账赠送的金额</div>
        </div>

        <div class="layui-form-item">
            <label for="giftPoint" class="layui-form-label  layui-form-required">赠送积分</label>
            <div class="layui-input-inline">
                <input type="number" lay-affix="number" min="0" max="999999" name="giftPoint" lay-verType="tips" lay-verify="required|number" class="layui-input" value="0" placeholder="请输入赠送积分" lay-reqText="请输入赠送积分并为数字" />
            </div>
            <div class="layui-form-mid layui-word-aux">充值支付后，实际到账赠送的积分</div>
        </div>

        <div class="layui-form-item">
            <label for="sortId" class="layui-form-label  layui-form-required">显示排序</label>
            <div class="layui-input-inline">
                <input type="number" lay-affix="number" min="0" max="999999" name="sortId" lay-verType="tips" lay-verify="required|number" class="layui-input" value="0" placeholder="请输入显示排序" lay-reqText="请输入显示排序并为数字" />
            </div>
            <div class="layui-form-mid layui-word-aux">从小到大在前端显示</div>
        </div>

        <div class="layui-form-item">
            <label for="isEnable" class="layui-form-label  layui-form-required">是否启用</label>
            <div class="layui-input-inline">
                <input type="checkbox" lay-filter="switch" name="isEnable" lay-skin="switch" lay-text="开启|关闭">
            </div>
            <div class="layui-form-mid layui-word-aux">只有设置为开启才会在前端显示</div>
        </div>

        <div class="layui-form-item text-right core-hidden">
            <input type="button" class="layui-btn" lay-submit lay-filter="LAY-app-CoreCmsTopUpType-createForm-submit" id="LAY-app-CoreCmsTopUpType-createForm-submit" value="确认添加">
        </div>
    </div>
</script>
<script>
    var debug = layui.setter.debug;
    layui.data.done = function (d) {
        //开启调试情况下获取接口赋值数据
        if (debug) { console.log(d.params.data); }
        layui.use(['admin', 'form', 'laydate', 'upload', 'coreHelper', 'cropperImg'],
            function () {
                var $ = layui.$
                    , form = layui.form
                    , admin = layui.admin
                    , laydate = layui.laydate
                    , upload = layui.upload
                    , cropperImg = layui.cropperImg
                    , coreHelper = layui.coreHelper;

                form.verify({

                    verifytitle: [/^.{0,50}$/, '标题最大只允许输入50位字符'],
                });
                //重载form
                form.render(null, 'LAY-app-CoreCmsTopUpType-createForm');
            })
    };
</script>
